﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ITProject.WebUI.Models.ProjectAdmin
{
    public class ProjectAdminManageTeamUserViewModel
    {
        public List<SelectListItem> UsersInTeam { get; set; }
        public List<SelectListItem> OtherUsers { get; set; }
        public string TeamName { get; set; }

        public static ProjectAdminManageTeamUserViewModel Convert(IEnumerable<String> usersT, IEnumerable<String> nousers, string teamName)
        {
            ProjectAdminManageTeamUserViewModel mv = new ProjectAdminManageTeamUserViewModel();
            mv.UsersInTeam = new List<SelectListItem>();
            mv.OtherUsers = new List<SelectListItem>();
            foreach (String name in usersT)
            {
                mv.UsersInTeam.Add(new SelectListItem { Text = name });
            }
            foreach (String name in nousers)
            {
                mv.OtherUsers.Add(new SelectListItem {  Text=name });
            }
            mv.TeamName = teamName;
            return mv;
        }
    }
}